import { ref } from "vue";
import { defineStore } from "pinia";
import { getLayoutApi } from "@/apis/layoutApi";
export const useCategoryStore = defineStore("category", () => {
    // 初始化请求回来数据的容器
  const categoryList = ref([]);
//   调用getLayout方法发起请求
  const getLayout = async () => {
    const res = await getLayoutApi();
    categoryList.value = res.result;
  };
  return {
    // 暴露出方法和数据供其他页面使用
    getLayout,
    categoryList
  }
});

